package io.renren.modules.sys.controller;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.common.validator.ValidatorUtils;
import io.renren.modules.sys.entity.ShopOrderEntity;
import io.renren.modules.sys.entity.UsersEntity;
import io.renren.modules.sys.service.ShopOrderService;
import io.renren.modules.sys.service.UsersService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.SimpleDateFormat;
import java.util.*;


/**
 * 订单
 *
 * @author Mark
 * @email sunlightcs@gmail.com
 * @date 2019-10-25 17:16:55
 */
@RestController
@RequestMapping("sys/merchantorder")
public class MerchantOrderController {
    @Autowired
    private ShopOrderService shopOrderService;

    @Autowired
    private UsersService usersService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("sys:merchantorder:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = shopOrderService.queryPage(params);

        return R.ok().put("page", page);
    }

    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Integer id){
        ShopOrderEntity shopOrder = shopOrderService.getById(id);

        return R.ok().put("shopOrder", shopOrder);
    }

}
